package com.yanqu.road.server.cross3server.cmd.chat;

import com.yanqu.road.pb.worldmessage.WorldMessageProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.ActivityChatMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Cross3Protocol;

@Cmd(code = Cross3Protocol.C3_CLEAR_CHANNEL_ACTIVITY_CHAT, desc = "清空跨地区活动聊天")
public class ClearChannelActivityChatCmd extends CrossCommand {

    private int activityId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        WorldMessageProto.SyncClearChatMsg reqMsg = WorldMessageProto.SyncClearChatMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        ActivityChatMgr.clearChatMsg(activityId);
    }

    @Override
    public void sendData() {

    }
}
